package com.ykw.parking.config;

import com.ykw.parking.service.MailServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MyMvcConfig implements WebMvcConfigurer {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        System.out.println("============");
        registry.addViewController("/main.html").setViewName("homePage");

        registry.addViewController("/buying.html").setViewName("buying");
    }
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/uploadView/**").addResourceLocations("file:"+
                "C:\\Users\\凯文的computer\\IdeaProjects\\parking\\src\\main\\resources\\static\\saveimage\\");
    }
}
